package com.dxy.df.modules.service.impl;

import com.dxy.df.constants.ConstStrings;
import com.dxy.df.core.shiro.ShiroUtils;
import com.dxy.df.utils.UcBeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import com.dxy.df.modules.bean.entity.UserAcceptRiceRecordEntity;
import com.dxy.df.modules.bean.vo.UserAcceptRiceRecordVo;
import com.dxy.df.modules.bean.query.UserAcceptRiceRecordQuery;
import com.dxy.df.modules.bean.put.UserAcceptRiceRecordPut;
import com.dxy.df.modules.dao.UserAcceptRiceRecordMapper;
import com.dxy.df.modules.service.UserAcceptRiceRecordService;


/**
 * @author biz@dxy.cn
 * @describe 收饭记录
 * @date 2019-10-25 15:36:06
 */
@Service
public class UserAcceptRiceRecordServiceImpl implements UserAcceptRiceRecordService {
	@Autowired
	private UserAcceptRiceRecordMapper userAcceptRiceRecordMapper;
	
	@Override
	public UserAcceptRiceRecordEntity queryObject(UserAcceptRiceRecordQuery query){
		return userAcceptRiceRecordMapper.queryObject(query);
	}
	
	@Override
	public List<UserAcceptRiceRecordVo> queryList(UserAcceptRiceRecordQuery query){
		return userAcceptRiceRecordMapper.queryList(query);
	}
	
	@Override
	public int queryTotal(UserAcceptRiceRecordQuery query){
		return userAcceptRiceRecordMapper.queryTotal(query);
	}
	
	@Override
	public void save(UserAcceptRiceRecordPut put){
		UserAcceptRiceRecordEntity entity = UcBeanUtils.copyPropertiesForDDL(put,
				UserAcceptRiceRecordEntity.class, ConstStrings.ADD);
		entity.setAcceptUserId(put.getAcceptUserId());
		userAcceptRiceRecordMapper.save(entity);
	}
	
	@Override
	public void update(UserAcceptRiceRecordPut put){
		UserAcceptRiceRecordEntity entity = UcBeanUtils.copyPropertiesForDDL(put, UserAcceptRiceRecordEntity.class, "");
		entity.setAcceptUserId(put.getAcceptUserId());
		userAcceptRiceRecordMapper.update(entity);
	}
	
	@Override
	public void delete(Integer id){
		userAcceptRiceRecordMapper.delete(id);
	}

	@Override
    public int deleteBatch(Integer[] ids){
		return userAcceptRiceRecordMapper.deleteBatch(ids);
	}


}
